// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ValidataTag.java

package validata;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class ValidataTag
{

	public String tag;
	private String dbase;
	private String table;
	private String field1;
	private String field2;
	private String fieldValue;
	private nseer_db dba;

	public ValidataTag()
	{
		dbase = "";
		table = "";
		field1 = "";
		field2 = "";
		fieldValue = "";
	}

	public String validata(String dbase, String table, String field1, String fieldValue, String field2)
	{
		this.dbase = dbase;
		this.table = table;
		this.field1 = field1;
		this.field2 = field2;
		this.fieldValue = fieldValue;
		try
		{
			dba = new nseer_db(dbase);
			ResultSet rs = dba.executeQuery((new StringBuilder("select * from ")).append(table).append(" where ").append(field1).append("='").append(fieldValue).append("'").toString());
			if (rs.next())
				tag = rs.getString(field2);
			dba.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return tag;
	}
}
